﻿using System.Collections.Generic;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

namespace FAQ
{
    [TestFixture]
    public class SubmittingSuggestions
    {
        [Test]
        public void WhenSuggestionIsMade_ItsAddedToTheBacklog()
        {
            SuggestionBox box = new SuggestionBox();
            Suggestion original = new Suggestion("Support versions", "Can you make it support versioning?");
            box.Submit(original);

            Suggestion dequeued = box.Dequeue();

            Assert.That(dequeued.Title, Is.EqualTo(original.Title));
            Assert.That(dequeued.Body, Is.EqualTo(original.Body));
        }
    }


    public class Suggestion
    {
        public Suggestion(string questionTitle, string questionBody)
        {
            Title = questionTitle;
            Body = questionBody;
        }

        public string Title { get; set; }
        public string Body { get; set; }
    }


    public class SuggestionBox
    {
        Queue<Suggestion> questions = new Queue<Suggestion>();

        public void Submit(Suggestion suggestion)
        {
            questions.Enqueue(suggestion);
        }

        public Suggestion Dequeue()
        {
            return questions.Dequeue();
        }
    }
}
